<?phpuse Illuminate\Database\Eloquent\Model;use Illuminate\Database\Capsule\Manager as DB;class dispatchstoreModel extends Model{	protected $table 		= 'dispatch_store';	public	  $primaryKey	= 'id';	protected $appends = ['store_names'];    protected function serializeDate($date)    {        return $date->format('Y-m-d H:i:s');    }    public function getStoreNamesAttribute()    {        $store_names = '';        if(!empty($this->attributes['store_ids'])){            $store_ids_arr = explode(',', $this->attributes['store_ids']);            $store_names_temp = DB::table('store')->whereIn('id', $store_ids_arr)->pluck('name');            if($store_names_temp){                $store_names_arr = $store_names_temp->toArray();                $store_names = implode(',', $store_names_arr);            }            unset($store_ids_arr, $store_names_temp, $store_names_arr);        }        return $store_names;    }}